#ifndef __GND_MODULE_TASKMANAGER_H__
#define __GND_MODULE_TASKMANAGER_H__

#include <gtkmm/box.h>
#include <gtkmm/builder.h>
#include <gtkmm/label.h>
#include <gtkmm/button.h>
#include <gtkmm/progressbar.h>
#include <gtkmm/popover.h>
#include <gtkmm/listbox.h>

#include "Module.h"

namespace Gnodroid {

    class Task;
    enum class TaskProgressType;
    enum class TaskState;

    class ModuleTaskmanager:
            public Module
    {
    public:

        ModuleTaskmanager();
        void start();
        void stop();

    protected:
    private:

        class __TaskProgressUi :
            public Gtk::Box
        {
        public:
            static __TaskProgressUi* create();
            __TaskProgressUi(BaseObjectType* cobject,
                             const Glib::RefPtr<Gtk::Builder>& builder);

            void setTask(Task* task);

        protected:
        private:
            Glib::RefPtr<Gtk::Builder> m_refBuilder;
            TaskProgressType m_type;
            TaskState m_state;

            Gtk::Label* m_pLbLabel;
            Gtk::Label* m_pLbMessage;
            Gtk::Button* m_pBtnControl;
            Gtk::ProgressBar* m_pProbProgress;

        };


        Gtk::Popover* m_popTasklist;
        Gtk::ListBox* m_listbTasklist;


    };
}


#endif
